package com.dsg.entity.apply;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 連絡人/通訊位址資訊
 * </p>
 *
 * @author system
 * @since 2020-07-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_apply_contact")
@ApiModel(value = "DsgApplyContact对象", description = "連絡人/通訊位址資訊")
public class DsgApplyContact implements Serializable {

    private static final long serialVersionUID = 1L;

//    @ApiModelProperty(value = "车OID")
//    @TableField(exist = false)
//    private List<String> carOidList;

    @ApiModelProperty(value = "主鍵")
    @TableId("OID")
    private String oid;

    @ApiModelProperty(value = "郵寄資料車輛")
    @TableField(exist = false)
    private List<DsgApplyCar> carList;

    @ApiModelProperty(value = "類型")
    @TableField("CONTACT_TYPE")
    private Integer contactType;

    @ApiModelProperty(value = "出咭信抬頭")
    @TableField("LETTER_HEAD")
    private String letterHead;

    @ApiModelProperty(value = "电话号")
    @TableField("PHONE_NUMBER")
    private String phoneNumber;

    @ApiModelProperty(value = "外鍵")
    @TableField("PID")
    private String pid;

    @ApiModelProperty(value = "關係類型")
    @TableField("RELATION_TYPE")
    private String relationType;

    public void setRelationType(String relationType) throws Exception {
        if ("".equals(relationType))
            throw new Exception("聯絡人關係不能為空");
        this.relationType = relationType;
    }

    @ApiModelProperty(value = "姓名")
    @TableField("CONTACT_NAME")
    private String contactName;

    @ApiModelProperty(value = "電郵")
    @TableField("CONTACT_MAIL")
    private String contactMail;

    @ApiModelProperty(value = "郵寄地址")
    @TableField("CONTACT_ADDR")
    private String contactAddr;


    /**
     * 创建人
     */
    @TableField(value = "CREATER")
    @ApiModelProperty(value = "创建人", name = "creater")
    private String creater;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "UPDATER")
    @ApiModelProperty(value = "更新人", name = "updater")
    private String updater;

    /**
     * 更新时间
     */
    @TableField(value = "UPDATE_TIME")
    @ApiModelProperty(value = "更新时间", name = "updateTime")
    private Date updateTime;

    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    @ApiModelProperty(value = "核对状态")
    @TableField("VERIFY")
    private Integer verify;

    /** 未核对 */
    public static final Integer VERIFY_NO = 0;
    /** 完成核对 */
    public static final Integer VERIFY_YES = 1;

    /** 通訊位址 */
    public static final Integer CONTACT_TYPE_ADDRESS = 1;
    /** 連絡人 */
    public static final Integer CONTACT_TYPE_MAN = 2;
}
